<!DOCTYPE html>
<html lang=zh>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />


  <title>Apollo携程配置管理平台初体验 | Hexo</title>
  <meta name="description" content="今天发现了一个开源项目，专门做配置管理的，看介绍功能也是很强大，初步体验运行了一下，后续计划部署到实际项目深入体验一下。 官方介绍Apollo（阿波罗）是携程框架部门研发的配置管理平台，能够集中化管理应用不同环境、不同集群的配置，配置修改后能够实时推送到应用端，并且具备规范的权限、流程治理等特性。 服务端基于Spring Boot和Spring Cloud开发，打包后可以直接运行，不需要额外安装T">
<meta name="keywords" content="配置">
<meta property="og:type" content="article">
<meta property="og:title" content="Apollo携程配置管理平台初体验">
<meta property="og:url" content="http://sangshi.oschina.io/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="今天发现了一个开源项目，专门做配置管理的，看介绍功能也是很强大，初步体验运行了一下，后续计划部署到实际项目深入体验一下。 官方介绍Apollo（阿波罗）是携程框架部门研发的配置管理平台，能够集中化管理应用不同环境、不同集群的配置，配置修改后能够实时推送到应用端，并且具备规范的权限、流程治理等特性。 服务端基于Spring Boot和Spring Cloud开发，打包后可以直接运行，不需要额外安装T">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://ov81buv8l.bkt.clouddn.com/apollo1.png">
<meta property="og:updated_time" content="2017-09-01T14:35:27.121Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Apollo携程配置管理平台初体验">
<meta name="twitter:description" content="今天发现了一个开源项目，专门做配置管理的，看介绍功能也是很强大，初步体验运行了一下，后续计划部署到实际项目深入体验一下。 官方介绍Apollo（阿波罗）是携程框架部门研发的配置管理平台，能够集中化管理应用不同环境、不同集群的配置，配置修改后能够实时推送到应用端，并且具备规范的权限、流程治理等特性。 服务端基于Spring Boot和Spring Cloud开发，打包后可以直接运行，不需要额外安装T">
<meta name="twitter:image" content="http://ov81buv8l.bkt.clouddn.com/apollo1.png">
  <!-- Canonical links -->
  <link rel="canonical" href="http://sangshi.oschina.io/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/index.html">

    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">


    <link rel="icon" href="/favicon.png" type="image/x-icon">

  <!-- font-awesome CSS -->
  <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/css/style.css">



</head>


<body class="main-center">
  <section class="mainside">
  <div class="slimContent">
    <div class="navbar-header">


      <div class="profile-block text-center">
        <a id="avatar" href="https://git.oschina.net/sangshi" target="_blank">
          <img class="thumb-xl img-circle img-rotate" src="/images/avatar.jpg" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">sangshi</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">我欲成仙，法力无边</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="fa fa-map-marker"></i> GuangZhou, China</small>
      </div>

      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="搜索" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat"><i class="fa fa-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." x-webkit-speech />
            <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
            <!-- <span class="ins-close ins-selectable"><i class="fa fa-times"></i></span> -->
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>

</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav main-nav">



        <li class="menu-item menu-item-home">
          <a href="/.">

            <i class="fa fa-fw fa-dashboard"></i>

            <span class="menu-title">首页</span>
          </a>
        </li>



        <li class="menu-item menu-item-archives">
          <a href="/archives">

            <i class="fa fa-fw fa-delicious"></i>

            <span class="menu-title">归档</span>
          </a>
        </li>



        <li class="menu-item menu-item-categories">
          <a href="/categories">

            <i class="fa fa-fw fa-folder"></i>

            <span class="menu-title">分类</span>
          </a>
        </li>



        <li class="menu-item menu-item-tags">
          <a href="/tags">

            <i class="fa fa-fw fa-tags"></i>

            <span class="menu-title">标签</span>
          </a>
        </li>



        <li class="menu-item menu-item-about">
          <a href="/about">

            <i class="fa fa-fw fa-coffee"></i>

            <span class="menu-title">关于</span>
          </a>
        </li>

      </ul>
      <div class="footer">


    <ul class="social-links">

        <li><a href="https://git.oschina.net/sangshi" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="fa fa-github"></i></a></li>

        <li><a href="https://git.oschina.net/sangshi" target="_blank" title="Weibo" data-toggle=tooltip data-placement=top><i class="fa fa-weibo"></i></a></li>

        <li><a href="https://git.oschina.net/sangshi" target="_blank" title="Twitter" data-toggle=tooltip data-placement=top><i class="fa fa-twitter"></i></a></li>

        <li><a href="https://git.oschina.net/sangshi" target="_blank" title="Behance" data-toggle=tooltip data-placement=top><i class="fa fa-behance"></i></a></li>

        <li><a href="/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="fa fa-rss"></i></a></li>

    </ul>

    <div class="copyright">
        &copy; 2017 John Doe<a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备18158798号</a><a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备18158798号</a>
        <div class="publishby">
        	<!-- Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. -->
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div>
    </div>
</div>
    </nav>
  </div>
</section>


    <section class="sidebar">
  <div class="slimContent">

      <div class="widget">
    <h3 class="widget-title">公告</h3>
    <div class="widget-body">
        <div id="board">

            <p>您好，您是第<span id="busuanzi_value_site_uv">0</span>位访客</p>

            <div class="content">
                <p>欢迎交流与分享经验!</p>
            </div>
        </div>
    </div>
</div>



  <div class="widget">
    <h3 class="widget-title">分类</h3>
    <div class="widget-body">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/NOSQL/">NOSQL</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/git/">git</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hexo/">hexo</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/其他/">其他</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/开源项目/">开源项目</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>




  <div class="widget">
    <h3 class="widget-title">标签</h3>
    <div class="widget-body">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo-plugins/">hexo plugins</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nosql/">nosql</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/oschina/">oschina</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/">redis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/servlet/">servlet</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/商品详情页/">商品详情页</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/电商/">电商</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/码云/">码云</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/配置/">配置</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>




  <div class="widget">
    <h3 class="widget-title">标签云</h3>
    <div class="widget-body tagcloud">
      <a href="/tags/git/" style="font-size: 13px;">git</a> <a href="/tags/hexo/" style="font-size: 14px;">hexo</a> <a href="/tags/hexo-plugins/" style="font-size: 13px;">hexo plugins</a> <a href="/tags/nosql/" style="font-size: 13px;">nosql</a> <a href="/tags/oschina/" style="font-size: 13px;">oschina</a> <a href="/tags/redis/" style="font-size: 13px;">redis</a> <a href="/tags/servlet/" style="font-size: 13px;">servlet</a> <a href="/tags/商品详情页/" style="font-size: 13px;">商品详情页</a> <a href="/tags/电商/" style="font-size: 13px;">电商</a> <a href="/tags/码云/" style="font-size: 13px;">码云</a> <a href="/tags/配置/" style="font-size: 14px;">配置</a>
    </div>
  </div>



  <div class="widget">
    <h3 class="widget-title">归档</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/11/">十一月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/09/">九月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/08/">八月 2017</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/02/">二月 2016</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>




  <div class="widget">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">

          <li>

            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/NOSQL/">NOSQL</a>
              </p>
              <p class="item-title">
                <a href="/2017/11/26/Linux-Redis安装配置和使用/" class="title">Linux Redis安装配置和使用</a>
              </p>
              <p class="item-date">
                <time datetime="2017-11-26T05:10:29.000Z" itemprop="datePublished">2017-11-26</time>
              </p>
            </div>
          </li>

          <li>

            <div class="item-inner">
              <p class="item-category">

              </p>
              <p class="item-title">
                <a href="/2017/09/02/商品详情页系统的Servlet3异步化实践-摘抄/" class="title">商品详情页系统的Servlet3异步化实践[摘抄]</a>
              </p>
              <p class="item-date">
                <time datetime="2017-09-02T15:58:37.000Z" itemprop="datePublished">2017-09-02</time>
              </p>
            </div>
          </li>

          <li>

            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/开源项目/">开源项目</a>
              </p>
              <p class="item-title">
                <a href="/2017/08/28/swagger-文档框架/" class="title">swagger 文档框架</a>
              </p>
              <p class="item-date">
                <time datetime="2017-08-28T03:17:25.000Z" itemprop="datePublished">2017-08-28</time>
              </p>
            </div>
          </li>

          <li>

            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/开源项目/">开源项目</a>
              </p>
              <p class="item-title">
                <a href="/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/" class="title">Apollo携程配置管理平台初体验</a>
              </p>
              <p class="item-date">
                <time datetime="2017-08-24T14:12:29.000Z" itemprop="datePublished">2017-08-24</time>
              </p>
            </div>
          </li>

          <li>

            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/hexo/">hexo</a>
              </p>
              <p class="item-title">
                <a href="/2017/08/23/hexo-various-configuration-problems/" class="title">Hexo各类配置问题</a>
              </p>
              <p class="item-date">
                <time datetime="2017-08-23T15:56:49.000Z" itemprop="datePublished">2017-08-23</time>
              </p>
            </div>
          </li>

      </ul>
    </div>
  </div>



  </div>
</section>



<section class="main">
  <div class="content">
  <article id="post-apolo-ctrip-configuration-management-platform-initial-experience" class="article article-type-post" itemscope itemprop="blogPost">

    <header class="article-header">



    <h1 class="article-title" itemprop="name">
      Apollo携程配置管理平台初体验
    </h1>



      <div class="article-meta">
        <span class="article-date">
    <i class="fa fa-calendar-check-o"></i>
	<a href="/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/" class="article-date">
	  <time datetime="2017-08-24T14:12:29.000Z" itemprop="datePublished">2017-08-24</time>
	</a>
</span>

  <span class="article-category">
    <i class="fa fa-folder"></i>
    <a class="article-category-link" href="/categories/开源项目/">开源项目</a>
  </span>


  <span class="article-tag">
    <i class="fa fa-tag"></i>
	<a class="article-tag-link" href="/tags/配置/">配置</a>
  </span>



	<span class="article-read hidden-xs">
	    <i class="fa fa-eye" aria-hidden="true"></i>
	    <span id="busuanzi_container_page_pv">
			阅读<span id="busuanzi_value_page_pv">0</span>次
		</span>
	</span>


        <span class="post-comment"><i class="fa fa-commenting-o"></i> <a href="/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/#comments" class="article-comment-link">评论</a></span>


		<span class="post-wordcount hidden-xs">字数统计: 1,104(字)</span>


		<span class="post-readcount hidden-xs">阅读时长: 5(分)</span>


      </div>

    </header>
    <div class="article-entry markdown-body" itemprop="articleBody">

        <pre><code>今天发现了一个开源项目，专门做配置管理的，看介绍功能也是很强大，初步体验运行了一下，后续计划部署到实际项目深入体验一下。
</code></pre><h3 id="官方介绍"><a href="#官方介绍" class="headerlink" title="官方介绍"></a>官方介绍</h3><p>Apollo（阿波罗）是携程框架部门研发的配置管理平台，能够集中化管理应用不同环境、不同集群的配置，配置修改后能够实时推送到应用端，并且具备规范的权限、流程治理等特性。</p>
<p>服务端基于Spring Boot和Spring Cloud开发，打包后可以直接运行，不需要额外安装Tomcat等应用容器。</p>
<p>Java客户端不依赖任何框架，能够运行于所有Java运行时环境，同时对Spring/Spring Boot环境也有较好的支持。</p>
<p>.Net客户端不依赖任何框架，能够运行于所有.Net运行时环境</p>
<p>项目地址：<a href="https://github.com/ctripcorp/apollo" target="_blank" rel="external">https://github.com/ctripcorp/apollo</a></p>
<h3 id="快速体验"><a href="#快速体验" class="headerlink" title="快速体验"></a>快速体验</h3><h4 id="1、Java环境依赖"><a href="#1、Java环境依赖" class="headerlink" title="1、Java环境依赖"></a>1、Java环境依赖</h4><ul>
<li>Apollo服务端：JDK1.8+</li>
<li>Apollo客户端：JDK1.7+</li>
</ul>
<h4 id="2、mysql版本"><a href="#2、mysql版本" class="headerlink" title="2、mysql版本"></a>2、mysql版本</h4><ul>
<li>版本要求 &gt; 5.6.5<br>原因在于Apollo的表结构对timestamp使用了多个default声明</li>
</ul>
<h4 id="3、Git环境"><a href="#3、Git环境" class="headerlink" title="3、Git环境"></a>3、Git环境</h4><p>这个基本都是必备的吧，快速体验的项目也需要运行.sh脚本，因此可以通过右键菜单（windows环境）git bash here（MinGW）来运行脚本</p>
<h4 id="4、快速体验安装包"><a href="#4、快速体验安装包" class="headerlink" title="4、快速体验安装包"></a>4、快速体验安装包</h4><p>官方提供的已经编译打包好的安装包，可以通过以下两种方式下载</p>
<ul>
<li>从Github下载 ：<a href="https://github.com/nobodyiam/apollo-build-scripts" target="_blank" rel="external">apollo-build-scripts</a>项目</li>
<li>百度网盘：<a href="https://pan.baidu.com/s/1skRAQfV" target="_blank" rel="external">下载</a></li>
</ul>
<p>压缩包有一个可以自启动的jar包，里面包含了所有依赖jar包以及一个内置的tomcat容器</p>
<h4 id="5、数据库相关配置"><a href="#5、数据库相关配置" class="headerlink" title="5、数据库相关配置"></a>5、数据库相关配置</h4><ul>
<li>解压后找到sql目录，里面有apolloconfigdb.sql和apolloconfigdb.sql，将这2个sql导入到你本地的mysql数据库里</li>
<li>编辑根目录下的demo.sh，修改如下信息</li>
</ul>
<blockquote>
<p>注意：填入的用户需要具备对ApolloPortalDB和ApolloConfigDB数据的读写权限。(一般而言，本地调试我们都会使用root账户)</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">#apollo config db info</div><div class="line">apollo_config_db_url=jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8</div><div class="line">apollo_config_db_username=用户名</div><div class="line">apollo_config_db_password=密码（如果没有密码，留空即可）</div><div class="line"></div><div class="line"># apollo portal db info</div><div class="line">apollo_portal_db_url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8</div><div class="line">apollo_portal_db_username=用户名</div><div class="line">apollo_portal_db_password=密码（如果没有密码，留空即可）</div></pre></td></tr></table></figure>
<h4 id="6、启动Apollo平台"><a href="#6、启动Apollo平台" class="headerlink" title="6、启动Apollo平台"></a>6、启动Apollo平台</h4><ul>
<li>该项目将会启动3个服务，端口分别是8070、8080、8090，请确保这3个端口没有被占用</li>
<li>在根目录右键菜单选择git bash here，打开git命令窗口输入以下命令启动项目</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">./demo.sh start</div></pre></td></tr></table></figure>
<p>如下信息代表启动完成：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line">$ ./demo.sh start</div><div class="line">Windows new JAVA_HOME is: /d/PROGRA~1/Java/JDK18~1.0_7</div><div class="line">==== starting service ====</div><div class="line">Service logging file is ./service/apollo-service.log</div><div class="line">rm: cannot remove &apos;./service/apollo-service.jar&apos;: Device or resource busy</div><div class="line">ln: failed to create hard link &apos;./service/apollo-service.jar&apos;: File exists</div><div class="line">Started [19844]</div><div class="line">Waiting for config service startup....</div><div class="line">Config service started. You may visit http://localhost:8080 for service status now!</div><div class="line">Waiting for admin service startup..</div><div class="line">Admin service started</div><div class="line">==== starting portal ====</div><div class="line">Portal logging file is ./portal/apollo-portal.log</div><div class="line">rm: cannot remove &apos;./portal/apollo-portal.jar&apos;: Device or resource busy</div><div class="line">ln: failed to create hard link &apos;./portal/apollo-portal.jar&apos;: File exists</div><div class="line">Started [668]</div><div class="line">Waiting for portal startup...</div><div class="line">Portal started. You can visit http://localhost:8070 now!</div></pre></td></tr></table></figure></p>
<h4 id="7、使用apollo项目查看配置"><a href="#7、使用apollo项目查看配置" class="headerlink" title="7、使用apollo项目查看配置"></a>7、使用apollo项目查看配置</h4><p>打开配置中心可用查看如下，这里添加了两个key（username和password），一会使用客户端获取配置用。<br><img src="http://ov81buv8l.bkt.clouddn.com/apollo1.png" alt=""></p>
<h4 id="8、运行客户端程序获取配置"><a href="#8、运行客户端程序获取配置" class="headerlink" title="8、运行客户端程序获取配置"></a>8、运行客户端程序获取配置</h4><p>使用git命令窗口输入一下命令启动客户端<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">./demo.sh client</div></pre></td></tr></table></figure></p>
<p>如下信息待办启动完成：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line">$ ./demo.sh client</div><div class="line">Windows new JAVA_HOME is: /d/PROGRA~1/Java/JDK18~1.0_7</div><div class="line">[framework-foundation] build.properties not found from classpath: /META-INF/build.properties.</div><div class="line">[framework-foundation] App ID is set to SampleApp by app.id property in app.properties InputStream.</div><div class="line">[framework-foundation] /opt/settings/server.properties does not exist or is not readable.</div><div class="line">[framework-foundation] C:/opt/settings/server.properties does not exist or is not readable.</div><div class="line">[framework-foundation] Environment is set to [dev] by JVM system property &apos;env&apos;.</div><div class="line">[framework-foundation] Sub env is set to null. Because it is not available in property &apos;subenv&apos; from the properties InputStream.</div><div class="line">[framework-foundation] Data Center is not available from server.properties.</div><div class="line">[framework-foundation] Data Center is not available by OS environment variable ci_located_code.</div><div class="line">[framework-foundation] Data Center is not available by OS environment variable CI_located_code. It is set to null.</div><div class="line">[framework-foundation] http port is not available from JVM system property &apos;port.http.server</div><div class="line">[framework-foundation] http port is not available from OS environment variable &apos;SERVER_HTTP_PORT. Default http port [0] is used.</div><div class="line">[framework-foundation] /opt/settings/deploy.properties does not exist or is not readable.</div><div class="line">[framework-foundation] C:/opt/settings/deploy.properties does not exist or is not readable.</div><div class="line">Apollo Config Demo. Please input key to get the value. Input quit to exit.</div></pre></td></tr></table></figure></p>
<p>测试获取配置文件，发现配置均能正确获取<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">timeout</div><div class="line">Loading key : timeout with value: 100</div><div class="line">&gt; username</div><div class="line">Loading key : username with value: root</div><div class="line">&gt; password</div><div class="line">Loading key : password with value: root</div><div class="line">&gt;</div></pre></td></tr></table></figure></p>


    </div>
    <footer class="article-footer">
      <blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">

    <li class="post-copyright-link hidden-xs">
      <strong>本文链接：</strong>
      <a href="http://sangshi.oschina.io/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/" title="Apollo携程配置管理平台初体验" target="_blank" rel="external">http://sangshi.oschina.io/2017/08/24/apolo-ctrip-configuration-management-platform-initial-experience/</a>
    </li>

    <li class="post-copyright-license">
      <strong>版权声明： </strong> 本博客所有文章除特别声明外，均采用 <a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN协议</a> 许可协议。转载请注明出处！
    </li>
  </ul>
</blockquote>


<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://git.oschina.net/sangshi" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="/images/avatar.jpg" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://git.oschina.net/sangshi" target="_blank"><span class="text-dark">sangshi</span><small class="ml-1x">我欲成仙，法力无边</small></a></h3>
        <div>~~~~~~~</div>
      </div>
    </figure>
  </div>
</div>


    </footer>
  </article>


  <div id="comments">


    <div id="uyan_frame"></div>


  </div>



</div>

  <nav class="bar bar-footer clearfix" data-stick-bottom>
  <div class="bar-inner">

  <ul class="pager pull-left">

    <li class="prev">
      <a href="/2017/08/28/swagger-文档框架/" title="swagger 文档框架"><i class="fa fa-angle-left" aria-hidden="true"></i>&nbsp;&nbsp;上一篇</a>
    </li>


    <li class="next">
      <a href="/2017/08/23/hexo-various-configuration-problems/" title="Hexo各类配置问题">下一篇&nbsp;&nbsp;<i class="fa fa-angle-right" aria-hidden="true"></i></a>
    </li>

  </ul>



  <div class="bar-right">
    <div class="share-component" data-sites="weibo,qq,wechat,facebook,twitter" data-mobile-sites="weibo,qq,qzone"></div>
  </div>

  </div>
</nav>



</section>

  <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>
<script src="/js/plugin.js"></script>
<script src="/js/application.js"></script>




        <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/',
        CONTENT_URL: '/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>
<script src="/js/insight.js"></script>



<script defer src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>







    <script defer type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=[object Object]"></script>







</body>
</html>
